home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / AppleScript / Additions / ACME Script Widgets 1.0 / Join List ƒ / Join List READ ME < prev    next >
Encoding:
Text File  |  1994-11-15  |  4.4 KB  |  144 lines  |  [ttro/ttxt]

  1.  
  2. ____________________________________________________
  3.  
  4.     Join List (ie, Detokenize) ver. 1.1
  5.  
  6.         Copyright (C) 1994 Wayne Walrath
  7.  
  8. ____________________________________________________
  9.  
  10. This software is free for personal use. To obtain a cheap and simple license
  11. for
  12. corporate, commercial or institutional use, contact the author at one of the
  13. addresses listed at the end of this document. THIS SOFTWARE IS PROVIDED AS IS
  14. WITHOUT WARRANTIES. USE AT YOUR OWN RISK! You are encouraged to share this
  15. software with other people and to upload it to online services, but you may
  16. not
  17. charge money for it and you should only transfer the complete package. Contact
  18. me if you doubt whether you have a complete package. Inclusion on CD-ROMs
  19. requires explicit permission from me (the author).
  20.  
  21.  
  22. Join List is an AppleScript Scripting Addition (OSAX) which forms a string
  23. from a list of items, inserting delimiters between the strings.
  24.  
  25.  
  26. Join List ver 1.1 includes several changes from the ver 1.0 Join List. Please
  27. see the end of this document for a summary of the changes.
  28.  
  29.  
  30. INSTALLATION:
  31. ______________________
  32. To install: Drag Join List to the Scripting Additions folder inside the
  33. Extensions folder.
  34.  
  35.  
  36.  
  37. USAGE:
  38. _______________
  39.  
  40. join list <list of strings> with delimiters <list of delims> 
  41.  
  42.  
  43. the first <string> parameter is a list of zero or more strings to make one
  44. string out of. There is no limit on the size of the items other than
  45. available memory.
  46.  
  47. the <list of delims> is a list of zero or more items to insert between the
  48. items
  49. of the first list. There is no limit on the size of the tokens other than
  50. available memory.
  51.  
  52.  
  53.  
  54. Delimiters are inserted between items of the first list sequentially; when the
  55. end of the delimiter list is reached, the Scripting Addition begins again with
  56. the first delimiter (so in effect, they are inserted in a rotating fashion).
  57.  
  58.  
  59.         **  **  **  **  **  **  **  **
  60.  
  61. CLARIFICATION TO USAGE:
  62. _______________
  63.  
  64. Here are a couple samples to clarify how Join List works.
  65.     set jList to {"Join", "List", "Ver1.0" }
  66.     set dList to {space}
  67.     
  68.     join list jList with delimiters dList
  69.     => "Join List Ver1.0"
  70.  
  71. The _space_ character is repeatedly inserted between the items in the first
  72. list. I don't think this needs much more explaining, so let's move on to more
  73. complex examples.
  74.  
  75.     set jList to {"One", "Two", "Three", "Four", "Five" }
  76.     set dList to {"$","#"}
  77.     join list jList with delimiters dList
  78.     => "One$Two#Three$Four#Five"
  79.  
  80. The "$" is inserted between the first two items and the "#" between the second
  81. and third items, then because the end of the delimiter list was reached, it
  82. starts over at the beginning of the delimiters again with "$", continuing on in
  83. this manner until all of the strings in jList have been added.
  84.  
  85.  
  86. If an empty list of delimiters is specified ({}), the command behaves exactly as
  87. if you had used AppleScript to coerce the list of strings to a single string.
  88.  
  89.     set jList to {"One", "Two", "Three", "Four", "Five"}
  90.     join list jList with delimiters {}
  91.     => "OneTwoThreeFourFive"
  92.  
  93.  
  94. If the list of strings to be joined contains only a single element, join list
  95. returns just that element with none of the tokens appeneded.
  96.  
  97.     join list "one" with delimiters {"&", "*"}
  98.     => "one"
  99.  
  100.  
  101. If you want any of your delimiters on the front or end of the returned string,
  102. use AppleScript's built-in capabilities for this.
  103.  
  104.     set jList to {"One", "Two", "Three", "Four", "Five" }
  105.     set myString to "|" & (join list jList with delimiters "|") & "|"
  106.     => "|One|Two|Three|Four|Five|"
  107.  
  108. Notice in this last example how I passed "|" as the delimiter; since it was only
  109. a single item, the AppleEvent manager handles coercing the string to a list for
  110. the join list OSAX. This only works with a single item, if there are more items
  111. you must make them into a list when calling join list.
  112.  
  113. For more examples, see the included demo script.
  114.  
  115.  
  116. CHANGE LOG:
  117. _______________
  118. * ver 1.1 15Nov94
  119. - Removed limit on size of delimiter items.
  120. - Removed the syntax for choosing where to insert delimiters and the optional
  121. ending paramter.
  122.  
  123. * ver1.0 2Nov94
  124. - First public release.
  125.  
  126. ______________________
  127. Comments, bug reports and suggestions are welcomed. If you have any ideas for
  128. useful Scripting Additions which haven't been written yet, send me a message
  129. describing your idea.
  130.  
  131.  
  132.     ___________________________
  133.         Wayne Walrath
  134.         2010 Ravenswood Dr.
  135.         Evansville, IN 47714
  136.         (812) 476-8610
  137.         walrath@cs.indiana.edu
  138.         CIS: 70233,3151 
  139.     ___________________________
  140.  
  141.  
  142. We now return you to the regularly
  143. scheduled program already in progress...
  144.